From 1c9f52038b9ac0b9a5a5a7c2376b59fd28f1d1a6 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 9 Sep 2012 16:02:15 -0400 Subject: [PATCH] widget-factory: Add a second page The widget-factory was pretty much overflowing, so I've made it page, and started to fill the second page with vertical spin buttons. New examples and widgets should be added to page 2 now. --- demos/widget-factory/widget-factory.c | 23 + demos/widget-factory/widget-factory.ui | 2861 ++++++++++++------------ 2 files changed, 1495 insertions(+), 1389 deletions(-) diff --git a/demos/widget-factory/widget-factory.c b/demos/widget-factory/widget-factory.c index 7c30f91f18..84ead9749d 100644 --- a/demos/widget-factory/widget-factory.c +++ b/demos/widget-factory/widget-factory.c @@ -65,12 +65,26 @@ show_about (GtkMenuItem *item, GtkWidget *window) g_object_unref (pixbuf); } +static void +on_page_toggled (GtkToggleButton *button, + GtkNotebook *pages) +{ + gint page; + + if (!gtk_toggle_button_get_active (button)) + return; + + page = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (button), "page")); + gtk_notebook_set_current_page (pages, page); +} + int main (int argc, char *argv[]) { GtkBuilder *builder; GtkWidget *window; GtkWidget *widget; + GtkWidget *notebook; gboolean dark = FALSE; gtk_init (&argc, &argv); @@ -88,6 +102,15 @@ main (int argc, char *argv[]) g_signal_connect (widget, "toggled", G_CALLBACK (dark_toggled), NULL); gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (widget), dark); + notebook = (GtkWidget*) gtk_builder_get_object (builder, "toplevel_notebook"); + widget = (GtkWidget*) gtk_builder_get_object (builder, "togglepage1"); + g_object_set_data (G_OBJECT (widget), "page", GINT_TO_POINTER (0)); + g_signal_connect (widget, "toggled", G_CALLBACK (on_page_toggled), notebook); + + widget = (GtkWidget*) gtk_builder_get_object (builder, "togglepage2"); + g_object_set_data (G_OBJECT (widget), "page", GINT_TO_POINTER (1)); + g_signal_connect (widget, "toggled", G_CALLBACK (on_page_toggled), notebook); + widget = (GtkWidget*) gtk_builder_get_object (builder, "aboutmenuitem"); g_signal_connect (widget, "activate", G_CALLBACK (show_about), window); diff --git a/demos/widget-factory/widget-factory.ui b/demos/widget-factory/widget-factory.ui index 22a95187e1..b76e04e8d4 100644 --- a/demos/widget-factory/widget-factory.ui +++ b/demos/widget-factory/widget-factory.ui @@ -475,6 +475,47 @@ Suspendisse feugiat quam quis dolor accumsan cursus. True + + + True + False + False + + + + True + horizontal + True + center + True + + + + True + Page 1 + False + + + + + True + Page 2 + False + togglepage1 + + + + + + + True + True + + True @@ -485,7 +526,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus. - True + False True @@ -515,121 +556,662 @@ Suspendisse feugiat quam quis dolor accumsan cursus. - + True - False - 6 + False - + True - False vertical - 4 - + True False - True - - - comboboxentry + 6 + + + True + False + vertical + 4 + + + True + False + True + + + comboboxentry + + + + Donald Duck + Mickey Mouse + Jet McQuack + + + + False + False + 0 + + + + + True + False + False + True + + + False + • + comboboxentry + + + + + False + False + 1 + + + + + True + True + • + entry + + + False + False + 2 + + + + + True + False + True + • + entry + + + False + False + 3 + + + + + True + False + 20 + + + True + False + label + + + False + True + 0 + + + + + True + False + False + label + + + False + True + 1 + + + + + True + True + • + adjustment2 + + + False + False + 2 + + + + + True + True + • + False + + + False + False + 3 + + + + + False + False + 4 + + + + + True + False + True + True + + + checkbutton + True + True + False + False + 0 + True + True + + + 0 + 0 + 1 + 1 + + + + + checkbutton + True + True + False + False + 0 + True + + + 0 + 1 + 1 + 1 + + + + + checkbutton + True + True + True + False + False + 0 + True + + + 0 + 2 + 1 + 1 + + + + + checkbutton + True + False + True + False + False + 0 + True + True + + + 0 + 3 + 1 + 1 + + + + + checkbutton + True + False + True + False + False + 0 + True + + + 0 + 4 + 1 + 1 + + + + + checkbutton + True + False + True + True + False + False + 0 + True + + + 0 + 5 + 1 + 1 + + + + + radiobutton + True + True + False + False + 0 + True + True + + + 1 + 0 + 1 + 1 + + + + + radiobutton + True + True + False + False + 0 + True + True + radiobutton1 + + + 1 + 1 + 1 + 1 + + + + + radiobutton + True + True + True + False + False + 0 + True + True + radiobutton1 + + + 1 + 2 + 1 + 1 + + + + + radiobutton + True + False + True + False + False + 0 + True + True + + + 1 + 3 + 1 + 1 + + + + + radiobutton + True + False + True + False + False + 0 + True + True + radiobutton3 + + + 1 + 4 + 1 + 1 + + + + + radiobutton + True + False + True + True + False + False + 0 + True + True + radiobutton3 + + + 1 + 5 + 1 + 1 + + + + + True + True + + + 0 + 6 + 1 + 1 + + + + + True + False + + + 1 + 6 + 1 + 1 + + + + + True + False + True + + + 2 + 0 + 1 + 1 + + + + + True + False + + + 2 + 1 + 1 + 1 + + + + + True + False + True + False + + + 2 + 3 + 1 + 1 + + + + + True + False + False + + + 2 + 4 + 1 + 1 + + + + + False + False + 5 + + + + False + False + 4 + 0 + - - Donald Duck - Mickey Mouse - Jet McQuack - - - - False - False - 0 - - - - - True - False - False - True - - + + + True False - • - comboboxentry + vertical - - - - False - False - 1 - - - - - True - True - • - entry - - - False - False - 2 - - - - - True - False - True - • - entry - - - False - False - 3 - - - - - True - False - 20 - - - True - False - label - - - False - True - 0 - + + False + True + 1 + - + + 110 True - False False - label - - - False - True - 1 - - - - - True - True - • - adjustment2 + vertical + 4 + + + togglebutton + True + True + True + False + + + False + False + 0 + + + + + togglebutton + True + False + True + True + False + + + False + False + 1 + + + + + togglebutton + True + True + True + False + True + + + False + False + 2 + + + + + togglebutton + True + False + True + True + False + True + + + False + False + 3 + + + + + True + False + liststore1 + 0 + + + + 2 + + + + + False + True + 5 + + + + + True + False + False + liststore1 + 1 + + + + 2 + + + + + False + False + 6 + + + + + True + True + True + False + + + False + False + 6 + + + + + True + True + True + False + #31316867a09f + + + False + True + 8 + + + + + True + False + + + False + True + 8 + + + + + True + False + 0.6 + + + False + True + 9 + + + + + True + False + 0 + 5 + 2 + 1 + + + False + True + 10 + + False @@ -638,633 +1220,563 @@ Suspendisse feugiat quam quis dolor accumsan cursus. - + True - True - • - False + False + vertical False - False + True 3 - - - False - False - 4 - - - - - True - False - True - True - - - checkbutton - True - True - False - False - 0 - True - True - - - 0 - 0 - 1 - 1 - - - - - checkbutton - True - True - False - False - 0 - True - - - 0 - 1 - 1 - 1 - - - - - checkbutton - True - True - True - False - False - 0 - True - - - 0 - 2 - 1 - 1 - - - - - checkbutton - True - False - True - False - False - 0 - True - True - - - 0 - 3 - 1 - 1 - - - - - checkbutton - True - False - True - False - False - 0 - True - - - 0 - 4 - 1 - 1 - - - - - checkbutton - True - False - True - True - False - False - 0 - True - - - 0 - 5 - 1 - 1 - - - - radiobutton - True - True - False - False - 0 - True - True - - - 1 - 0 - 1 - 1 - - - - - radiobutton - True - True - False - False - 0 - True - True - radiobutton1 - - - 1 - 1 - 1 - 1 - - - - - radiobutton - True - True - True - False - False - 0 - True - True - radiobutton1 - - - 1 - 2 - 1 - 1 - - - - - radiobutton - True - False - True - False - False - 0 - True - True - - - 1 - 3 - 1 - 1 - - - - - radiobutton - True - False - True - False - False - 0 - True - True - radiobutton3 - - - 1 - 4 - 1 - 1 - - - - - radiobutton - True - False - True - True - False - False - 0 - True - True - radiobutton3 - - - 1 - 5 - 1 - 1 - - - - - True - True - - - 0 - 6 - 1 - 1 - - - - - True - False - - - 1 - 6 - 1 - 1 - - - - - True - False - True - - - 2 - 0 - 1 - 1 - - - - + True False - - - 2 - 1 - 1 - 1 - - - - - True - False - True - False - - - 2 - 3 - 1 - 1 - - - - - True - False - False - - - 2 - 4 - 1 - 1 - - - - - False - False - 5 - - - - - False - False - 4 - 0 - - - - - True - False - vertical - - - False - True - 1 - - - - - 110 - True - False - vertical - 4 - - - togglebutton - True - True - True - False - - - False - False - 0 - - - - - togglebutton - True - False - True - True - False - - - False - False - 1 - - - - - togglebutton - True - True - True - False - True - - - False - False - 2 - - - - - togglebutton - True - False - True - True - False - True - - - False - False - 3 - - - - - True - False - liststore1 - 0 - - - - 2 - - - - - False - True - 5 - - - - - True - False - False - liststore1 - 1 - - - - 2 - - - - - False - False - 6 - - - - - True - True - True - False - - - False - False - 6 - - - - - True - True - True - False - #31316867a09f - - - False - True - 8 - - - - - True - False - - - False - True - 8 - - - - - True - False - 0.6 - - - False - True - 9 - - - - - True - False - 0 - 5 - 2 - 1 - - - False - True - 10 - - - - - False - False - 2 - - - - - True - False - vertical - - - False - True - 3 - - - - - True - False - vertical - 4 - - - True - False - vertical - 8 - True + vertical + 4 + + + True + False + vertical + 8 + True + + + True + False + 0.5 + + + False + False + 0 + + + + + True + False + 0.5 + True + + + False + False + 1 + + + + + False + False + 0 + + + + + True + False + + + True + False + True + vertical + True + + + True + True + adjustment1 + False + 75 + False + + + False + True + 0 + + + + + True + False + True + adjustment1 + False + 75 + False + + + False + True + 1 + + + + + True + True + 0 + + + + + False + False + 1 + + + + + True + False + True + + + True + False + True + 4 + + + True + False + vertical + 0.5 + + + False + True + 0 + + + + + True + False + vertical + 0.5 + True + + + False + True + 1 + + + + + False + False + 0 + + + + + True + False + True + 4 + + + 100 + True + True + vertical + adjustment1 + False + 75 + False + + + False + True + 0 + + + + + 100 + True + False + True + vertical + adjustment1 + False + 75 + False + + + False + True + 1 + + + + + False + False + 1 + + + + + True + True + 2 + + + + + True + False + vertical + + + True + False + + + link button + True + True + True + True + False + none + http://www.gtk.org + + + + + False + True + 0 + + + + + True + True + + + True + True + in + + + True + False + + + True + False + Lorem ipsum dolor sit amet, consectetur adipiscing elit. +Nullam fringilla, est ut feugiat ultrices, elit lacus ultricies nibh, id commodo tortor nisi id elit. +Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. +Morbi vel elit erat. Maecenas dignissim, dui et pharetra rutrum, tellus lectus rutrum mi, a convallis libero nisi quis tellus. +Nulla facilisi. Nullam eleifend lobortis nisl, in porttitor tellus malesuada vitae. +Aenean lacus tellus, pellentesque quis molestie quis, fringilla in arcu. +Duis elementum, tellus sed tristique semper, metus metus accumsan augue, et porttitor augue orci a libero. +Ut sed justo ac felis placerat laoreet sed id sem. Proin mattis tincidunt odio vitae tristique. +Morbi massa libero, congue vitae scelerisque vel, ultricies vel nisl. +Vestibulum in tortor diam, quis aliquet quam. Praesent ut justo neque, tempus rutrum est. +Duis eu lectus quam. Vivamus eget metus a mauris molestie venenatis pulvinar eleifend nisi. +Nulla facilisi. Pellentesque at dolor sit amet purus dapibus pulvinar molestie quis neque. +Suspendisse feugiat quam quis dolor accumsan cursus. + + + + + + + + + True + False + expander + + + + + False + True + 1 + + + + + False + True + 3 + + + + + False + False + 4 + + - + True False - 0.5 + vertical False - False - 0 + True + 5 + + + + + True + False + vertical + True + + + True + False + 0 + in + + + True + False + 12 + + + + + + + + True + False + <b>In</b> + True + + + + + True + True + 0 + + + + + True + False + 0 + out + + + True + False + 12 + + + + + + + + True + False + <b>Out</b> + True + + + + + True + True + 1 + + + + + True + False + 0 + + + True + False + 12 + + + + + + + + True + False + <b>Etched out</b> + True + + + + + True + True + 2 + + + + + True + False + 0 + etched-out + + + True + False + 12 + + + + + + + + True + False + <b>Etched out</b> + True + + + + + True + True + 3 + + + + + True + True + 6 - + True False - 0.5 - True + vertical False - False - 1 + True + 7 - - - False - False - 0 - - - - - True - False - + True False - True vertical - True + 4 - + + 150 True True - adjustment1 - False - 75 - False + always + in + + + True + True + liststore1 + False + 0 + + + + + + Cool + + + + 0 + + + + + + + Icon + + + true + + + 1 + + + + + + + Name + + + + 2 + + + + + + + Nick + + + + 3 + + + + + + - False + True True 0 - + True - False True - adjustment1 - False - 75 - False + in + + + True + True + textbuffer1 + + - False + True True 1 @@ -1273,826 +1785,397 @@ Suspendisse feugiat quam quis dolor accumsan cursus. True True - 0 + 6 + 8 False - False - 1 + True + 10 + 2 + + + + + True + False + + + False + True + 3 - + True False + 5 + 5 + 5 + 10 True - + True - False - True - 4 + True - + True False vertical - 0.5 + + + + + + + + True + False + page 1 - False - True - 0 + False - + True False vertical - 0.5 - True + + + + + + 1 + + + + + True + False + page 2 - False - True 1 + False + + + + + True + False + vertical + + + + + + 2 + + + + + True + False + page 3 + + + 2 + False False - False + True 0 - + + True + True + right + + + True + False + vertical + + + + + + + + True + False + page 1 + + + False + + + + + True + False + vertical + + + + + + 1 + + + + + True + False + page 2 + + + 1 + False + + + + + True + False + vertical + + + + + + 2 + + + + + True + False + page 3 + + + 2 + False + + + + + False + True + 1 + + + + True - False - True - 4 + True + bottom - - 100 + True - True + False vertical - adjustment1 - False - 75 - False + + + + + + + + True + False + page 1 - False - True - 0 + False - - 100 + True - False - True + False vertical - adjustment1 - False - 75 - False + + + - False - True 1 - - - False - False - 1 - - - - - True - True - 2 - - - - - True - False - vertical - - - True - False - - - link button + + True - True - True - True - False - none - http://www.gtk.org + False + page 2 + + 1 + False + - - - False - True - 0 - - - - - True - True - + True - True - in + False + vertical - - True - False - - - True - False - Lorem ipsum dolor sit amet, consectetur adipiscing elit. -Nullam fringilla, est ut feugiat ultrices, elit lacus ultricies nibh, id commodo tortor nisi id elit. -Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. -Morbi vel elit erat. Maecenas dignissim, dui et pharetra rutrum, tellus lectus rutrum mi, a convallis libero nisi quis tellus. -Nulla facilisi. Nullam eleifend lobortis nisl, in porttitor tellus malesuada vitae. -Aenean lacus tellus, pellentesque quis molestie quis, fringilla in arcu. -Duis elementum, tellus sed tristique semper, metus metus accumsan augue, et porttitor augue orci a libero. -Ut sed justo ac felis placerat laoreet sed id sem. Proin mattis tincidunt odio vitae tristique. -Morbi massa libero, congue vitae scelerisque vel, ultricies vel nisl. -Vestibulum in tortor diam, quis aliquet quam. Praesent ut justo neque, tempus rutrum est. -Duis eu lectus quam. Vivamus eget metus a mauris molestie venenatis pulvinar eleifend nisi. -Nulla facilisi. Pellentesque at dolor sit amet purus dapibus pulvinar molestie quis neque. -Suspendisse feugiat quam quis dolor accumsan cursus. - - - + + + 2 + - - + + True False - expander + page 3 + + 2 + False + False True - 1 + 2 - - - False - True - 3 - - - - - False - False - 4 - - - - - True - False - vertical - - - False - True - 5 - - - - - True - False - vertical - True - - - True - False - 0 - in - - - True - False - 12 - - - - - - - - True - False - <b>In</b> - True - - - - - True - True - 0 - - - - - True - False - 0 - out - - - True - False - 12 - - - - - - - - True - False - <b>Out</b> - True - - - - - True - True - 1 - - - - - True - False - 0 - - - True - False - 12 - - - - - - - - True - False - <b>Etched out</b> - True - - - - - True - True - 2 - - - - - True - False - 0 - etched-out - - - True - False - 12 - - - - - - - - True - False - <b>Etched out</b> - True - - - - - True - True - 3 - - - - - True - True - 6 - - - - - True - False - vertical - - - False - True - 7 - - - - - True - False - vertical - 4 - - - 150 - True - True - always - in - + True True - liststore1 - False - 0 - - - + left - - Cool + + True + False + vertical - - - 0 - + - - - Icon - - - true - - - 1 - - + + + True + False + page 1 + + False + - - Name + + True + False + vertical - - - 2 - + + + 1 + + + + + True + False + page 2 + + + 1 + False + - - Nick + + True + False + vertical - - - 3 - + + + 2 + + + + + True + False + page 3 + + + 2 + False + + + False + True + 3 + True True - 0 - - - - - True - True - in - - - True - True - textbuffer1 - - - - - True - True - 1 - - - - - True - True - 6 - 8 - - - - - False - True - 10 - 2 - - - - - True - False - - - False - True - 3 - - - - - True - False - 5 - 5 - 5 - 10 - True - - - True - True - - - True - False - vertical - - - - - - - - True - False - page 1 - - - False - - - - - True - False - vertical - - - - - - 1 - - - - - True - False - page 2 - - - 1 - False - - - - - True - False - vertical - - - - - - 2 - - - - - True - False - page 3 - - - 2 - False - - - - - False - True - 0 - - - - - True - True - right - - - True - False - vertical - - - - - - - - True - False - page 1 - - - False - - - - - True - False - vertical - - - - - - 1 - - - - - True - False - page 2 - - - 1 - False - - - - - True - False - vertical - - - - - - 2 - - - - - True - False - page 3 - - - 2 - False - - - - - False - True - 1 - - - - - True - True - bottom - - - True - False - vertical - - - - - - - - True - False - page 1 - - - False - - - - - True - False - vertical - - - - - - 1 - - - - - True - False - page 2 - - - 1 - False - - - - - True - False - vertical - - - - - - 2 - - - - - True - False - page 3 - - - 2 - False + 4 - - False - True - 2 - - + True - True - left - - - True - False - vertical - - - - - - - - True - False - page 1 - - - False - - + vertical + 6 + 6 - + True - False - vertical + horizontal + 4 - + + True + vertical + adjustment2 + - - - 1 - - - - - True - False - page 2 - - - 1 - False - - - - - True - False - vertical - + + True + False + vertical + adjustment1 + - - 2 - - - - - True - False - page 3 - - - 2 - False - - - False - True - 3 - - - True - True - 4 - -- 2.30.2